<template>
  <div class="saleBranch-container">
    <div class="select-box">
      <van-search v-model="query.keyword" show-action placeholder="请输入姓名">
        <template #action>
          <div @click="onSearch">搜索</div>
        </template>
      </van-search>
    </div>
    <div class="list-group scrollbar" ref="scrollbars">
      <div class="list-group1" v-if="dataList.length>0">
        <div class="list-box" v-for="(item,index) in dataList" :key="index">
          <div class="list-header">
            <div class="list-header-icon">
              <span class="icon" :class="'icon'+index" v-if="index<3"></span>
              <span>第{{index+1}}名</span>
            </div>
            <div class="list-header-name">{{item.uname}}</div>
          </div>
          <div class="demo-preview">
            <div class="row-s">
              <div class="col-s"></div>
              <div class="col-s">今日</div>
              <div class="col-s">昨日</div>
              <div class="col-s">本周</div>
              <div class="col-s">本月</div>
            </div>
            <div class="row-s">

           

              <div class="col-s">深耕班</div>
              <div class="col-s">{{item.child.kcshengencount.todaydata}}</div>
              <div class="col-s">{{item.child.kcshengencount.yesterdaydata}}</div>
              <div class="col-s">{{item.child.kcshengencount.weekdata}}</div>
              <div class="col-s">{{item.child.kcshengencount.monthdata}}</div>
            </div>
            <div class="row-s">

              <div class="col-s">教子助手</div>
              <div class="col-s">{{item.child.kcjiaozicount.todaydata}}</div>
              <div class="col-s">{{item.child.kcjiaozicount.yesterdaydata}}</div>
              <div class="col-s">{{item.child.kcjiaozicount.weekdata}}</div>
              <div class="col-s">{{item.child.kcjiaozicount.monthdata}}</div>
            </div>
          </div>
        </div>
      </div>
      <empty v-if="dataList.length == 0"></empty>
    </div>
  </div>
</template>
  <script> 
import {Search } from 'vant';
export default {
  components: {[Search.name]: Search},
  data() {
    return {
      refreshDisabled: false,
      showImg: false,
      loading: false,
      active: 0,
      finished: true,
      wxReadyOk: false,
      menuId: 3,
      baseUrl: this.$API.ASSET_IMAGES_URL,
      query: {
        pageIndex: 1,
        pageSize: 10,
        keyword: ''
      },
      total: 0,
      allTotal: 0,
      notTotal: 0,
      doneTotal: 0,
      listData: [],
      certificate: '',
      dataList: [],
      startTime:'',
      endTime:'',
      tabTitle:'bytoday',
      tabIndex:0,
    };
  },

  created() {
    this.initAjaxMethod();
    this.id = this.$route.query.id;//作业id
  },
  methods: {
    onSearch() {
      this.query.pageIndex = 1;
      this.$refs['scrollbars'].scrollTop = 0;
      this.initAjaxMethod();
    },
    //列表加载
    initAjaxMethod() {
      const toast = this.$toast.loading('加载中...');
      this.$http
        .post(this.$API.GET_PEROFFICE_SALEBRANCH, {
          keyword: this.query.keyword,
        })
        .then((data) => {
          toast.clear();
          if (data.code == 1) {
            let list = Array.isArray(data.list) ? data.list : [];
            this.dataList=list;

            // this.listData = Array.isArray(res.data) ? res.data : [];
          }
        });
    },
  }
};
  </script>
  
  <style lang="less">
.saleBranch-container {
  position: relative;
  .select-box {
    padding: 0 0.3rem;
    background: #fff;
    .van-cell {
      line-height: 0.6rem;
    }
    .van-search__action {
      font-size:0.3rem;
    }
  }
  .list-group {
    height: 86vh;
  }
  .list-group1 {
    padding: 0.3rem;
  }
  .list-box {
    background: #fff;
    border-radius: 0.2rem;
    box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 0.2rem;
  }
  .list-header {
    height: 1rem;
    line-height: 1rem;
    background: #fafafa;
    padding: 0 0.3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .list-header-icon {
    display: flex;
    align-items: center;
    span{
      font-size:0.32rem;
    }
  }
  .list-header-name{
    font-size: 0.3rem;
    color:#333;
  }
  .van-col {
    height: 0.72rem;
    line-height: 0.72rem;
    font-size: 0.3rem;
    text-align: center;
  }
  .demo-preview {
    padding: 0.2rem 0.3rem;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  }
  .demo-preview img {
    flex-shrink: 0;
    width: 0.64rem;
    height: 0.64rem;
    margin-right: 0.32rem;
    background: #eee;
    border-radius: 50%;
  }
  .demo-content {
    padding-top: 6px;
  }
  .demo-text {
    margin: 0.12rem 0 0;
    font-size: 0.3rem;
    line-height: 0.4rem;
  }
  .list-boxs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 0.8rem;
    line-height: 0.8rem;
    padding: 0 0.3rem;
  }
  .list-boxs span {
    font-size: 0.3rem;
    color: #888;
  }
  .detail-btn {
    padding: 0 0.3rem;
    height: 30px;
    line-height: 30px;
    border-radius: 24px;
    font-size: 0.3rem;
    color: #fff;
    background: rgb(255, 153, 0);
    font-style: normal;
  }
  .row-s {
    display: flex;
    align-items: center;
  }
  .col-s {
    height: 0.72rem;
    line-height: 0.72rem;
    font-size: 0.3rem;
    text-align: center;
    width: 20%;
  }
  .row-s:nth-of-type(even) {
    background: #ccffff;
  }
  .icon {
    width: 0.4rem;
    height: 0.56rem;
    margin-right: 0.12rem;
  }
  .icon0{
      background: url("../../../../assets/img/frist_icon1.png") center no-repeat;
      background-size: 100% 100%;
  }
  .icon1{
      background: url("../../../../assets/img/second_icon.png") center no-repeat;
      background-size: 100% 100%;
  }
  .icon2{
      background: url("../../../../assets/img/san_icon.png") center no-repeat;
      background-size: 100% 100%;
  }
}
</style>